package com.zhuangjie.redis.entity;

import lombok.Data;

import java.util.Objects;

/**
 * redis geo
 *
 * @author zhuangjie
 * @date 2024/01/19
 */
@Data
public class RedisGeo {
    private String key;
    private  Double longitude;
    private  Double latitude;
    private  String member;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RedisGeo redisGeo = (RedisGeo) o;
        return member == redisGeo.member &&
                Objects.equals(key, redisGeo.key);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, member);
    }

    public boolean checkInvalid() {
        return key != null && member != null &&
                longitude != null && latitude != null;
    }
}
